﻿namespace FFF.Test.Application.PublicService.AppService.TreeGrid
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// 树形节点输入的Dto
    /// </summary>
    public class TreeGridInDto
    {
        /// <summary>
        /// 父级节点
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        /// <value>The order.</value>
        /// <remarks>于大明</remarks>
        public string Order { get; set; }

        /// <summary>
        /// 默认第几页
        /// </summary>
        /// <value>The index of the page.</value>
        /// <remarks>于大明</remarks>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 默认的分页
        /// </summary>
        /// <value>The size of the page.</value>
        /// <remarks>于大明</remarks>
        public int PageSize { get; set; } = 9999;

        /// <summary>
        /// 默认的过滤条件
        /// </summary>
        /// <value>The filter.</value>
        /// <remarks>于大明</remarks>
        public string Filter { get; set; }

        /// <summary>
        /// 每页多少行
        /// </summary>
        /// <value>The rows.</value>
        /// <remarks>于大明</remarks>
        public int Rows { get; set; }

        /// <summary>
        /// 第几页
        /// </summary>
        public int Page { get; set; }

    }

    /// <summary>
    /// 树形节点输出的Dto
    /// </summary>
    public class TreeGridOutDto
    {
        /// <summary>
        /// Id
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 是否选中
        /// </summary>
        public int? Checked { get; set; } = null;

        /// <summary>
        /// 树形显示的值
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// Icon的集合
        /// </summary>
        public string IconCls { get; set; } = string.Empty;

        /// <summary>
        /// 展开的状态
        /// </summary>
        public string State { get; set; } = "closed";

        /// <summary>
        /// 属性
        /// </summary>
        public object Attributes { get; set; } = null;

        /// <summary>
        /// 父级GUID
        /// </summary>
        public Guid? Pid { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public List<TreeGridOutDto> Children { get; set; } = null;

        /// <summary>
        /// 父级编码
        /// </summary>
        public string ParentCode { get; set; }

        /// <summary>
        /// 排序编码
        /// </summary>
        public string OrderCode { get; set; }

    }

    /// <summary>
    /// tree表格的分页返回
    /// </summary>
    /// <remarks>于大明</remarks>
    public class TreeGridResult
    {
        /// <summary>
        /// 记录总条数(用于分页处理)
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 记录(用于分页处理)
        /// </summary>
        public List<TreeGridOutDto> Rows { get; set; }
    }
}
